<template>
  <a-select
    :dropdownStyle="{}"
    @change="selectedChange($event)"
    allowClear
    style="width: 100%"
    :maxTagCount="3"
    :placeholder="l('BaseLanguage')"
    v-model:value="form.targetValueFilter"
  >
    <a-select-option value="ALL">
      {{ l('All') }}
    </a-select-option>
    <a-select-option value="EMPTY">
      {{ l('EmptyOnes') }}
    </a-select-option>
  </a-select>
</template>
<script lang="ts">
  import { PagedListingComponentBase } from '/@/shared/component-base';
  import { LanguageServiceProxy } from '/@/shared/service-proxies';
  import { defineComponent } from 'vue';

  export default defineComponent({
    name: 'TargetValue',
    mixins: [PagedListingComponentBase],
    props: {
      value: {
        type: Array,
      },
    },
    emits: ['update:value', 'change'],
    data() {
      return {
        form: {
          targetValueFilter: '',
        },
        // 语言下拉
        ILanguageInfo: new Array<any>(),
        languageServiceProxy: new LanguageServiceProxy(),
        // 请求参数
      };
    },
    computed: {
      selectedRoleVal: {
        get(): any {
          return this.value;
        },
        set(val) {
          this.$emit('update:value', val);
        },
      },
    },
    created() {
      this.form.targetValueFilter = 'ALL';
      this.selectedRoleVal = this.form.targetValueFilter;
    },
    methods: {
      selectedChange(selectKey) {
        this.selectedRoleVal = selectKey;
        this.$emit('change', selectKey);
      },
    },
  });
</script>
